<template>
  <div
    class="card"
    :style="{ background: info.bgColor }"
    
  >
    <div class="title">
      {{ info.name }}
    </div>
    <div class="desc">
      {{ info.tips }}
    </div>
    <div class="info" v-for="(item, index) in info.productList" :key="index">
      <div class="info-item">
        <div class="title-box">
          <div class="left">{{ item.name }}</div>
          <div class="right">{{ item.no }}</div>
        </div>
        <div class="tag-box">
          <van-tag
            plain
            type="primary"
            v-for="(tag, index) in item.tags.split(',')"
            :key="index"
            >{{ tag }}</van-tag
          >
        </div>
        <div class="f-desc">
          <div class="left">
            <div class="percent">{{ item.rangeIndex }}</div>
            <div class="tip">{{ item.rangeText }}</div>
          </div>
          <div class="right">
            <van-button @click="$router.push(`/financeDetail/${item.id}`)">查看详情</van-button>
          </div>
        </div>
      </div>
      <div class="bottom">
        <img :src="symbolIcon" alt="" srcset="" />
        <div class="text">{{ item.description }}</div>
      </div>
    </div>
  </div>
</template>
<script>
import symbolIcon from "@/assets/images/finance-list/symbol-icon.png";

export default {
  props: {
    info: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {
      symbolIcon,
    };
  },
  components: {},
};
</script>
<style lang="scss" scoped>
.card {
  padding: 20px 10px;
  margin: 10px 10px 0;
  border-radius: 10px;
  & > .title,
  .desc {
    color: #fff;
    font-weight: bold;
    width: 100%;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    margin-left: 10px;
  }
  .desc {
    font-weight: 400;
    font-size: 14px;
    margin: 10px 0 20px;
    margin-left: 10px;
    color: #aecaef;
  }
  .info {
    margin-top: 20px;
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    .info-item {
      .title-box {
        display: flex;
        justify-content: space-between;
        color: #333;
        .left {
          font-weight: bold;
        }
        .right {
        }
      }
      .tag-box {
        margin: 10px 0 20px;
        margin-left: -10px;
        .van-tag--primary.van-tag--plain {
          color: #98abb6;
          margin-left: 10px;
        }
      }
      .f-desc {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
        padding-bottom: 10px;
        .left {
          .percent {
            color: #d6493d;
            font-weight: bold;
            font-size: 36px;
          }
          .tip {
            color: #9b9b9b;
            font-size: 14px;
            margin-bottom: 10px;
          }
        }
        .right {
          .van-button {
            background: linear-gradient(90deg, #e2d0c2 0%, #f8ece4 100%);
            color: #a58e7e;
            border-radius: 30px;
          }
        }
        border-bottom: 1px dashed #9b9b9b;
      }
    }
    .bottom {
      display: flex;
      align-items: center;
      img {
        width: 22px;
        height: 22px;
        object-fit: contain;
      }
      .text {
        font-size: 14px;
        margin-left: 20px;
      }
    }
  }
}
</style>
